public class SubStringDemo {

  public static void main(String[] args) {

    String a = "java is great!";
    System.out.println("a: " + a); // java is great!

    String b = a.substring(5);
    System.out.println("b: " + b); // is great!

    String c = a.substring(5, 7);
    System.out.println("c: " + c); // is

    String d = a.substring(5, a.length());
    System.out.println("d: " + d); // is great!

    System.out.println("a's length is: " + a.length()); // 14
  }
}
